{% extends 'index.html' %}
{% block page-title %}用户审计{% endblock %}

{% block page-content %}
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">审计日志列表</h3>
        </div>
        <div class="panel-body">
            <ul>

            </ul>
            <table class="table">
                <thead>
                <tr>
                    <th class="text-center">Session ID</th>
                    <th>堡垒机用户</th>
                    <th>登录时间</th>
                    <th>登录主机</th>
                    <th>登录用户名</th>
                    <th>停留时间</th>
                    <th>执行命令数</th>
                </tr>
                </thead>
                <tbody>

                {% for session_obj in session_objs %}
                    <tr>
                        <td class="text-center"><a class="btn-link"
                                                   href="{% url 'audit_log_detail' log_date session_obj.id %}">{{ session_obj.id }}</a>
                        </td>
                        <td>{{ session_obj.user.name }}</td>
                        <td>{{ session_obj.date }}</td>
                        <td>{{ session_obj.bind_host.host.hostname }}({{ session_obj.bind_host.host.ip_addr }})</td>
                        <td>{{ session_obj.bind_host.host_user.username }}</td>
                        <td>--</td>
                        <td>--</td>
                    </tr>
                {% endfor %}


                </tbody>
            </table>
        </div>
    </div>
{% endblock %}